#include "stdafx.h"
#include "CppUnitTest.h"
#include "MySolver/MySolver.h"
#include <SnakeLib/Board.h>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

using namespace snake;

namespace MySolverTests
{
	TEST_CLASS(isInCornerTest)
	{
	public:
		
		TEST_METHOD(OneWhenInLeftUpCorner)
			{
			// Arrange
			int expected = 1;
			Board board(4,4);
			board.SetCell(1, 1, snake::CELL_SNAKE_HEAD_DOWN);
			//Act
			int actual = MySolver::isInCorner(board);
			//Assert
			Assert::AreEqual(expected, actual);
			}

		TEST_METHOD(OneWhenInRightUpCorner)
			{
			// Arrange
			int expected = 2;
			Board board(4,4);
			board.SetCell(2, 1, snake::CELL_SNAKE_HEAD_DOWN);
			//Act
			int actual = MySolver::isInCorner(board);
			//Assert
			Assert::AreEqual(expected, actual);
			}
		TEST_METHOD(OneWhenInRightDownCorner)
			{
			// Arrange
			int expected = 3;
			Board board(4,4);
			board.SetCell(2, 2, snake::CELL_SNAKE_HEAD_DOWN);
			//Act
			int actual = MySolver::isInCorner(board);
			//Assert
			Assert::AreEqual(expected, actual);
			}
		TEST_METHOD(OneWhenInLeftDownCorner)
			{
			// Arrange
			int expected = 4;
			Board board(4,4);
			board.SetCell(1, 2, snake::CELL_SNAKE_HEAD_DOWN);
			//Act
			int actual = MySolver::isInCorner(board);
			//Assert
			Assert::AreEqual(expected, actual);
			}
	};
}